package io.netty.myExample.duyutian.test.内部类访问外部类的方法;

/**
 * @author duyutian
 * @version 1.0
 * @date 2020/6/11 11:36
 */
class father {

    public void eat() {
        System.out.println("父亲吃饭");
    }

    class son {
        public void eat() {
            System.out.println("儿子吃饭");
        }

        public void run() {
            //内部类访问外部类
            father.this.eat();
        }
    }

    public static void main(String[] args) {
        son son = new father().new son();
        son.run();
    }
}
